#include <iostream>
using namespace std;

class Base
{
  public:
    virtual void fun()
    {
      cout<<"Base::fun()"<<endl;
    }
};

class B:public Base
{
  public:
    void fun()
    {
      cout<<"B::fun()"<<endl;
    }
    void show()
    {
      cout<<"B::show()"<<endl;
      m_b=1;
    }
  private:
    int m_b;
};

void Active(Base *pb)
{
  pb->fun();
  B* b=dynamic_cast<B*>(pb);
  b->show();
}

int main()
{
  Base ba;
  B b;
  Active(&b);
  return 0;
}
